package com.ml.mall.service.payinfo;

import com.ml.mall.bean.req.ipay.Ipay88CallBackDto;
import com.ml.mall.bean.req.order.OrderPaymentDataQueryDto;
import com.ml.mall.entity.payinfo.SysPayinfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ml.mall.entity.sys.SysUser;

import java.math.BigDecimal;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
 *
 */
public interface SysPayinfoService extends IService<SysPayinfo> {

    /**
     * 创建订单支付信息，返回sdk订单支付请求信息
     * @param oid
     * @param truePay
     * @param user
     * @return
     * @throws NoSuchAlgorithmException
     */
    Map<String, String> createOrderPay(Long oid, BigDecimal truePay, SysUser user) throws NoSuchAlgorithmException;

    /**
     * 获取支付信息
     * @param payId 订单id
     * @return
     */
    SysPayinfo queryByPayId(Long payId);

    /**
     * 通过Ipay88回调参数进行更新
     * @param dto
     * @return
     */
    boolean updateByCallBackDto(Ipay88CallBackDto dto);
}
